package com.fanxuankai.boot.monitor.autoconfigure;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Set;

/**
 * @author fanxuankai
 */
@ConfigurationProperties(prefix = MonitorProperties.PREFIX)
public class MonitorProperties {
    public static final String PREFIX = "fxk.monitor";
    public static final String WECHAT_WEBHOOK = PREFIX + ".wechat-webhook";
    /**
     * 钉钉通知
     */
    private DingTalk dingTalk;
    /**
     * 企业微信通知
     */
    private String wechatWebhook;

    public DingTalk getDingTalk() {
        return dingTalk;
    }

    public void setDingTalk(DingTalk dingTalk) {
        this.dingTalk = dingTalk;
    }

    public String getWechatWebhook() {
        return wechatWebhook;
    }

    public void setWechatWebhook(String wechatWebhook) {
        this.wechatWebhook = wechatWebhook;
    }

    public static class DingTalk {
        public static final String ACCESS_TOKEN = PREFIX + ".ding-talk.access-token";
        /**
         * url
         */
        private String url = "https://oapi.dingtalk.com/robot/send";
        /**
         * 访问令牌
         */
        private String accessToken;
        /**
         * 密钥
         */
        private String secret;
        /**
         * 要 at 人的手机号
         */
        private Set<String> atMobiles;
        /**
         * 是否 at 所有人
         */
        private boolean atAll;

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getAccessToken() {
            return accessToken;
        }

        public void setAccessToken(String accessToken) {
            this.accessToken = accessToken;
        }

        public String getSecret() {
            return secret;
        }

        public void setSecret(String secret) {
            this.secret = secret;
        }

        public Set<String> getAtMobiles() {
            return atMobiles;
        }

        public void setAtMobiles(Set<String> atMobiles) {
            this.atMobiles = atMobiles;
        }

        public boolean isAtAll() {
            return atAll;
        }

        public void setAtAll(boolean atAll) {
            this.atAll = atAll;
        }
    }
}
